<?php /* Smarty version 2.6.18, created on 2010-03-11 09:18:39
         compiled from dataOFMA.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('function', 'cycle', 'dataOFMA.tpl', 98, false),)), $this); ?>
<div id="main_content">
<h1>Organization Maintenance</h1>
<div id="blanket" style="display:none;"></div>
<table class="blue" width="100%">
	<tr valign="top" width="100%">
		<td width="99%" align="left">
			<div id="search" >
				<form name="searchForm" id="searchForm" method="POST">
					<h3><b>Searching<b></h3>
					<table width="100%" >
						<tr>
							<td width="15%"><label>Country:</label></td>
							<td>
								<div id="country">
								<select id="country" name="country" onchange="doajaxAction('/admin/dataFMAProvince/country/'+document.searchForm.country.value,0,'province');">
									<option value=""> --- </option>
									<?php $_from = $this->_tpl_vars['countries']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['country']):
?>
									<option value="<?php echo $this->_tpl_vars['country']['country_code']; ?>
"><?php echo $this->_tpl_vars['country']['country']; ?>
</option>
									<?php endforeach; endif; unset($_from); ?>
								</select>
								</div>
							</td>
						</tr>
						<tr>
							<td><label>Province:</label></td>
							<td>
								<div id="province">
								<select name="province">
									<option value=""> --- </option>
								</select>
								</div>
							</td>
						</tr>
						<tr>
							<td><label>Name:</label></td>
							<td>
								<input type="text" name="names">
							</td>
							<td align="right">
								<input type="button" value="Go" onclick="search_organism();">
							</td>
						</tr>
					</table>
				</form>
			</div>
			<br><br>
		</td>
		<td>
			<a onclick="toggle_div('search');" href="javascript:void(0);">
				<img id="show_arrow" border="0" src="/app/default/www/images/arrow-down.png" alt="Show Search"/>
			</a>
		</td>
	</tr>
	<tr  valign="top" width="100%">
		<td width="99%" align="left">
			<div id="batch" style="display:none;" >
				<form name="mainForm" method="POST" id="mainForm" action="/admin/dataFMAImport" enctype="multipart/form-data">
					<h3><b>Batch Upload:</b></h3>
					<table width="100%">
						<tr>
							<td width="15%"><label>Click here to export spreadsheet:</label></td>
							<td><input type="button" onclick="export_excel();" value="Export"></td>
						</tr>
						<tr>
							<td>
								<input type="file" name="file" id="file" />
							</td>
							<td>
								<input type="submit" value="Upload">
							</td>
						</tr>
					</table>
					<br>
				</form>
			</div>
		</td>
		<td>
			<a onclick="toggle_div('batch');" href="javascript:void(0);">
				<img id="show_arrow" border="0" src="/app/default/www/images/arrow-down.png" alt="Show Search"/>
			</a>
		</td>
	</tr>
</table>
<br><br>
<form name="mainForm" method="POST" id="mainForm" action="/admin/dataFMASaveListChanges" enctype="multipart/form-data">
<input type="hidden" id="rowcount" value="<?php echo $this->_tpl_vars['rowcount']; ?>
">
<div id="data_table" width="100%">
	<!--table width="100%">
		<tr bgcolor="#cccccc">
			<td width="5%"></td>
			<td width="5%" align="center"><label><b>Delete</b></label></td>
			<td><label><b>Name</b></label></td>
			<td><label><b>Country</b></label></td>
			<td><label><b>Province</b></label></td>
			<td><label><b>Organization Type</b></label></td>
		</tr>
		<?php $_from = $this->_tpl_vars['results']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['result']):
?>
			<tr class="<?php echo smarty_function_cycle(array('values' => "blue,notify"), $this);?>
">
				<td width="5%" align="center"><input type="button" value="Edit" onclick="edit_item(<?php echo $this->_tpl_vars['result']['id']; ?>
);"></td>
				<td width="5%" align="center"><input type="checkbox" value="1" name="del_<?php echo $this->_tpl_vars['result']['id']; ?>
"></td>
				<td><label><?php echo $this->_tpl_vars['result']['name']; ?>
</label></td>
				<td><label><?php echo $this->_tpl_vars['result']['country']; ?>
</label></td>
				<td><label><?php echo $this->_tpl_vars['result']['province']; ?>
</label></td>
				<td><label><?php echo $this->_tpl_vars['result']['org_type']; ?>
</label></td>
			</tr>
		<?php endforeach; endif; unset($_from); ?>
	</table-->
<input type="button" value="Add" onclick="edit_item(0);">
<input type="submit" value="Save Changes">
</div>
</form>

<?php echo '
<script language="javascript">
	function edit_item(id){
		doajaxAction(\'/admin/dataFMAEdit/id/\'+id+\'/org_maintenance_type/dataOFM\',0,\'main_content\');
	}
	function search_organism(){
		var params=\'/country/\'+document.searchForm.country.value+
				   \'/province/\'+document.searchForm.province.value+
				   \'/names/\'+document.searchForm.names.value;
		doajaxAction(\'/admin/dataOFMASearch\'+params,0,\'data_table\');
	}
	function export_excel(){
		window.location="/admin/dataFMAExport";
	}
</script>
'; ?>

</div>
	
	
	